<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"
		 import="es.ats.codington.festival.domain.Event"
		 import="es.ats.codington.festival.domain.Place"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
	<head>
		<meta charset="UTF-8">
		<jsp:include page="wireframe.jsp"/>        
	</head>
	<body>
		<jsp:include page="navbar.jsp"/>
   	 	<%Event e= new Event();%>
        <%e=(Event) request.getAttribute("event");%> 
        <%Place p=new Place(); %>  
        <%p=(Place) request.getAttribute("place"); %>
	    <div class="row" style="margin-top:80px;">
	    	<div class="col-md-12">
	    		<div class="row thumbnail">
					<div class="col-md-6 col-xs-6">
						<img src="eventimage?eventid=<%=e.getEventId()%>" class="img-responsive">
					</div>
					<div class="col-md-6 col-xs-6">
						<div class="row">
							<div class="col-md-6 col-xs-6 caption">
								<h3><b><%=e.getName()%></b></h3>
							</div>
							<div class="col-md-6 col-xs-6 price caption">
								<h3>
								<label style="color:blue">$<%=e.getPrice()%></label></h3>
							</div>
						</div>
						<p><%=e.getDescription()%></p>
						<div class="row">
							<div class="col-md-6 col-xs-6 caption">
								<h4><b>Date: </b><%=e.getStart()%></h4>
							</div>
							<div class="col-md-6 col-xs-6 price caption">
								<h4><b>Duration: </b><%=e.getDuration()%> min.</h4>
							</div>
						</div>
						<div class="row">
							<div class="col-md-6 col-xs-6 caption">
								<h4><b>Place Name: </b><%=p.getPlaceName()%></h4>
							</div>
							<div class="col-md-6 col-xs-6 price caption">
								<h4><b>Place description: </b><%=p.getPlaceDescription()%></h4>
							</div>
						</div>
						<p><b>Seats available: </b><%=e.getSeatsAvailable()%> of <%=p.getCapacity()%></p>
						<div class="row">
							<c:if test="${registered==true}">
								<div class="col-md-6"><b><i>You are already registered on this event</i></b></div>
								<div class="col-md-6">
									<form class="navbar-form" action="eventunsignup" method="get">
										<div class="input-group">
											<div class="input-group-btn">
												<input type="hidden" value="<%=e.getEventId()%>" name="eventid">
												<button class="btn btn-danger btn-product" type="submit">
												<span class="glyphicon glyphicon-thumbs-down"></span> Unsign Up</a>
											</div>
										</div>
									</form>					
								</div>
							</c:if>
							<c:if test="${registered==false}">
								<div class="col-md-6"><b><i>You are not registered on this event</i></b></div>
								<div class="col-md-6">
									<form class="navbar-form" action="eventsignup" method="get">
										<div class="input-group">
											<div class="input-group-btn">
												<input type="hidden" value="<%=e.getEventId()%>" name="eventid">
												<button class="btn btn-success btn-product" type="submit">
												<span class="glyphicon glyphicon-thumbs-up"></span> Sign Up</a>
											</div>
										</div>
									</form>
								</div>
							</c:if>				
						</div>
					</div>
				</div>     
	        </div> 
		</div>
	</body>
</html>